package com.binguo.model.mapper;

import com.binguo.model.model.BaiduSdkSerialNum;
import com.binguo.model.model.BaiduSdkSerialNumExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface BaiduSdkSerialNumMapper {
    int countByExample(BaiduSdkSerialNumExample example);

    int deleteByExample(BaiduSdkSerialNumExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(BaiduSdkSerialNum record);

    int insertSelective(BaiduSdkSerialNum record);

    List<BaiduSdkSerialNum> selectByExample(BaiduSdkSerialNumExample example);

    BaiduSdkSerialNum selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") BaiduSdkSerialNum record, @Param("example") BaiduSdkSerialNumExample example);

    int updateByExample(@Param("record") BaiduSdkSerialNum record, @Param("example") BaiduSdkSerialNumExample example);

    int updateByPrimaryKeySelective(BaiduSdkSerialNum record);

    int updateByPrimaryKey(BaiduSdkSerialNum record);

    @Select("select serial_number from baidu_sdk_serial_num where device_id = #{deviceId} and status = 1")
    String selectSerialByDeviceId(@Param("deviceId") String deviceId);

    @Select("select id as id,status as status,serial_number as serialNumber,device_id as deviceId from baidu_sdk_serial_num where status = 0 limit 1")
    BaiduSdkSerialNum selectNoUseSerialByDeviceId();
}